import { request } from '@/utils/request'
import qs from 'qs'

// 商品添加到购物车
export const addToShopcart = data => {
  return request('/cart/toShoppingCart', 'get', data)
}
// 用户购物车列表
export const queryGoodsUser = data => {
  return request('/cart/queryGoodsByUserId', 'get', data)
}
// 修改数量
export const updateCartCount = data => {
  return request('/cart/updateCartprice', 'get', data)
}
// 删除购物车
export const deleteCartList = data => {
  return request('/cart/deleteGoods', 'get', data)
}
// 查询指定车辆详细信息
export const goPay = data => {
  return request('/cart/order', 'get', data)
}
// 当前用户的车辆信息screen

export const getUserCar = data => {
  return request('car/querycurrentusercar.do', 'post', qs.stringify(data))
}
// 多条件筛选
export const getScreenCar = data => {
  return request('car/querycarmulti.do', 'post', qs.stringify(data))
}
// 个人车辆发布
export const publishUserCar = data => {
  return request('car/publishcar.do', 'post', qs.stringify(data))
}
// 预约自营车
export const orderBusiness = data => {
  return request('car/reservecar.do', 'post', qs.stringify(data))
}
// 搜索车辆
export const navSearch = data => {
  return request('search/cars.do', 'post', qs.stringify(data))
}
// 车辆图片上传
export const publishImge = data => {
  return request('car/sendimages.do', 'post', data, {
    'Content-Type': 'multipart/form-data; boundary=<calculated when request is sent>'
  })
}
// 回收车iang
export const recoveryCar = data => {
  return request('car/recyclecar.do', 'post', qs.stringify(data))
}
// 卖出
export const sellpersonalCar = data => {
  return request('car/sellpersonalcar.do', 'post', qs.stringify(data))
}
// 下架
export const removepersonalCar = data => {
  return request('car/removepersonalcar.do', 'post', qs.stringify(data))
}
// 取消预约
export const cancelReserve = data => {
  return request('car/cancelreserve.do', 'post', qs.stringify(data))
}
// 修改指定车辆
export const editPersonalCar = data => {
  return request('car/editpersonalcar.do', 'post', qs.stringify(data))
}
